package entitiesIds;

import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * LeveldepartamentId entity. @author MyEclipse Persistence Tools
 */
@Embeddable
public class LeveldepartamentId implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = -4531286722012139750L;
	private Integer idUser;
	private Integer idDepartament;

	// Constructors

	/** default constructor */
	public LeveldepartamentId() {
	}

	/** full constructor */
	public LeveldepartamentId(Integer idUser, Integer idDepartament) {
		this.idUser = idUser;
		this.idDepartament = idDepartament;
	}

	// Property accessors

	@Column(name = "idUser", nullable = false)
	public Integer getIdUser() {
		return this.idUser;
	}

	public void setIdUser(Integer idUser) {
		this.idUser = idUser;
	}

	@Column(name = "idDepartament", nullable = false)
	public Integer getIdDepartament() {
		return this.idDepartament;
	}

	public void setIdDepartament(Integer idDepartament) {
		this.idDepartament = idDepartament;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof LeveldepartamentId))
			return false;
		LeveldepartamentId castOther = (LeveldepartamentId) other;

		return ((this.getIdUser() == castOther.getIdUser()) || (this
				.getIdUser() != null && castOther.getIdUser() != null && this
				.getIdUser().equals(castOther.getIdUser())))
				&& ((this.getIdDepartament() == castOther.getIdDepartament()) || (this
						.getIdDepartament() != null
						&& castOther.getIdDepartament() != null && this
						.getIdDepartament()
						.equals(castOther.getIdDepartament())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getIdUser() == null ? 0 : this.getIdUser().hashCode());
		result = 37
				* result
				+ (getIdDepartament() == null ? 0 : this.getIdDepartament()
						.hashCode());
		return result;
	}

	@Override
	public String toString() {
		return "LeveldepartamentId [idUser=" + idUser + ", idDepartament="
				+ idDepartament + "]";
	}

	
}